]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
authPrompt: Use the same hint text as the polkitDialog for the password
authorJonas Dreßler <verdre@v0yd.nl>
Fri, 14 Feb 2020 21:14:25 +0000 (22:14 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Mon, 17 Feb 2020 11:03:07 +0000 (11:03 +0000)
Be consistent and show the hint for the password entry that we already
show in the polkitDialog in the auth dialog.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/977

js/gdm/authPrompt.js

index 9a8cf44bf58f84da0172e5006f16a475522c73f9..8624d17f41de516b7859c445c02674e718bc6f4e 100644 (file)
@@ -227,8 +227,14 @@ var AuthPrompt = GObject.registerClass({
         }
 
         this._updateEntry(secret);
-        // HACK: the question comes directly from PAM
-        this.setQuestion(question.replace(/: *$/, '…').trim());
+
+        // Hack: The question string comes directly from PAM, if it's "Password:"
+        // we replace it with our own to allow localization, if it's something
+        // else we remove the last colon and any trailing or leading spaces.
+        if (question === 'Password:' || question === 'Password: ')
+            this.setQuestion(_('Password'));
+        else
+            this.setQuestion(question.replace(/: *$/, '').trim());
 
         this.updateSensitivity(true);
         this.emit('prompted');